package org.abacus.client.ui.control.widgets;

import org.abacus.client.ui.access.AbstractAccessData;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Widget;


public class LDialog extends AbstractAccessData {
	public static class Dialog extends org.eclipse.swt.widgets.Dialog {

		public Dialog(Shell parent) {
			super(parent);
		}

		public Dialog(Shell parent, int style) {
			super(parent, style);
		}

	}

	final Dialog control;

	public LDialog(Widget parent, int style) {
		this((Shell) parent, style);
	}

	public LDialog(Shell parent, int style) {
		super();
		this.control = new Dialog(parent, style);
	}

	public LDialog(Widget parent) {
		this((Shell) parent);
	}

	public LDialog(Shell parent) {
		super();
		this.control = new Dialog(parent);
	}

	public Control getControl() {
		return control.getParent();
	}

	@Override
	public String getValue() {
		return control.getText();
	}

	@Override
	public void setValue(String value) {
		if (null != value)
			control.setText(value);
	}
}
